package com.honglv.mapper;

import com.honglv.pojo.entity.Admin;
import com.honglv.pojo.entity.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

/**
 * @Auther: 生
 * @Date: 2024/04/02/14:41
 * @Description:
 */
@Mapper
public interface RegisterMapper {

    @Select("SELECT * FROM tb_admin WHERE code = #{code}")
    Admin selectByCode(String code);

    @Insert(
"insert into tb_admin (username, password, phone, name, age, sex, idNumber,avatar, openid, create_time, code)"  +
        "values" + "(#{username}, #{password}, #{phone}, #{name}, #{age}, #{sex}, #{idNumber}, #{avatar}, #{openid}, #{create_time}, #{code})")
    Integer saveAdmin(Admin admin);

    @Insert(
            "insert into tb_admin (username, password, phone, name, age, sex, idNumber,avatar, openid, create_time)"  +
                    "values" + "(#{username}, #{password}, #{phone}, #{name}, #{age}, #{sex}, #{idNumber}, #{avatar}, #{openid}, #{create_time})")
    Integer saveUser(User user);
}
